#include <iostream>
#include <set>

int main ()
{
	std::set<void*> myset;
	std::set<void*>::iterator it;
	int var = 1000;
	int var1 = 1000;

	// insert some values:
	void* tmp = (void*) &var;
	myset.insert(tmp);  // 10 20 30 40 50 60 70 80 90
	tmp = (void*) &var1;
	myset.insert(tmp);  // 10 20 30 40 50 60 70 80 90

	it = myset.begin();
	std::cout << *(int*)*it << std::endl;

	//++it;                                         // "it" points now to 20

	myset.erase (it);
	std::cout << 'X' << *it << std::endl;

	if (*it == NULL)
	{
		std::cout << "NULL" << std::endl;
	}

	for (it=myset.begin(); it!=myset.end(); ++it)
		std::cout << ' ' << *it << std::endl;
	std::cout << '\n';

	return 0;
}
